//
// Created by Asus on 2025/6/16.
//

#include <iostream>

#include "speech_manager.h"

/**
 * 演讲比赛流程管理系统
 * @return
 */
int main() {
    srand((unsigned int)time(NULL));
    SpeechManager manager;
    for (map<int, Speaker>::iterator it = manager.m_Speaker.begin(); it != manager.m_Speaker.end(); it++) {
        cout  << "选手编号：" << it->first
              << " 姓名： " << it->second.m_Name
              << " 成绩： " << it->second.m_Score[0] << endl;
    }
    int choice = 0; // 用来存储用户的选项
    while (true) {
        manager.showMenu();
        cout << "请输入您的选择： " << endl;
        cin >> choice; // 接受用户的选项
        switch (choice) {
            case 1: // 开始比赛
                manager.startSpeech();
                break;
            case 2: // 查看记录
                manager.saveRecord();
                break;
            case 3: // 清空记录
                manager.clearRecord();
                break;
            case 0: // 退出系统
                manager.exitSystem();
                break;
            default:
                break;
        }
    }
}
